package com.woniu.serverdriveruser.controller;

import com.woniu.internalcommon.dto.ResponseResult;
import com.woniu.serverdriveruser.service.CityDriverService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/cityDriver")
public class CityDriverController {

    @Autowired
    private CityDriverService cityDriverService;

    /**
     * 根据城市码查询当前城市是否有可用司机
     * @param cityCode
     * @return
     */
    @GetMapping("/isAvailableDriver")
    public ResponseResult isAvailableDriver(@RequestParam("cityCode") String cityCode){
       return cityDriverService.isAvailableDriver( cityCode);
    }
}
